package Test_test;

import dao.ITopicDao;
import dao.IUserDao;
import entity.Topic;
import dao.impl.TopicDaoImpl;
import dao.impl.UserDaoImpl;
import org.junit.Test;

import java.util.List;

public class Demo01 {
    IUserDao iud=new UserDaoImpl();
    ITopicDao itd=new TopicDaoImpl();

    @Test
    public void test01(){


        System.out.println(iud.register("haoke","123"));
    }
    @Test
    public void test02(){

        System.out.println(iud.login("admin","admin"));
    }
    @Test
    public void test03(){

        System.out.println(iud.getUid("admin").getUname());
    }

    @Test
    public void test04(){
        List<Topic> u=itd.getAll(5,1);
        for (Topic i: u) {
            System.out.println(i.getUid().getUname());
        }
    }
}
